package com.example.bloglearn;


import com.example.bloglearn.entity.User;
import com.example.bloglearn.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@SpringBootApplication

public class BlogLearnApplication {
    @Autowired
    private UserMapper userMapper;

    public static void main(String[] args) {
        SpringApplication.run(BlogLearnApplication.class, args);
    }
    @GetMapping("/user/findall")
    public List<User> index(){
        return userMapper.findAll();
    }
}
